package com.ssy.jt808.gateway.sdk.terminal.constant.location.addition;

import java.util.Map;
import java.util.TreeMap;

/**
 * 0x11 进出区域/路线报警附加信息
 *
 * @author wangzezhou
 */
public enum InOutAreaEnum{

  /** 圆形区域 */
  CircularArea(1),
  /** 矩形区域 */
  RectangularArea(2),
  /** 多边形区域 */
  PolygonalArea(3),
  /** 路径 */
  Route(4),
  ;

  InOutAreaEnum( int type ){
    this.type = type;
  }

  private final int type;

  public int areaType(){
    return this.type;
  }




  private static final Map<Integer,InOutAreaEnum> TYPE_MAP;

  static {
    TYPE_MAP = new TreeMap<>();
    InOutAreaEnum[] values = values();
    for(InOutAreaEnum value : values){
      TYPE_MAP.put(value.areaType(), value);
    }
  }

  public static InOutAreaEnum areaType( int type ){
    InOutAreaEnum inOutAreaEnum = TYPE_MAP.get(type);
    assert inOutAreaEnum!=null;
    return inOutAreaEnum;
  }
}
